﻿using System;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;

#nullable disable

namespace StartsEAS_API.Model.Models
{
    public partial class StarsEASContext : DbContext
    {
        public StarsEASContext()
        {
        }

        public StarsEASContext(DbContextOptions<StarsEASContext> options)
            : base(options)
        {
        }

        public virtual DbSet<Alert> Alerts { get; set; }
        public virtual DbSet<AlterClass> AlterClasses { get; set; }
        public virtual DbSet<AlterResult> AlterResults { get; set; }
        public virtual DbSet<AlterStu> AlterStus { get; set; }
        public virtual DbSet<AlterWorker> AlterWorkers { get; set; }
        public virtual DbSet<Area> Areas { get; set; }
        public virtual DbSet<City> Cities { get; set; }
        public virtual DbSet<Class> Classes { get; set; }
        public virtual DbSet<Classroom> Classrooms { get; set; }
        public virtual DbSet<College> Colleges { get; set; }
        public virtual DbSet<Course> Courses { get; set; }
        public virtual DbSet<CourseNature> CourseNatures { get; set; }
        public virtual DbSet<Disciplinary> Disciplinaries { get; set; }
        public virtual DbSet<DisciplinaryCategory> DisciplinaryCategories { get; set; }
        public virtual DbSet<Eapply> Eapplies { get; set; }
        public virtual DbSet<Earrange> Earranges { get; set; }
        public virtual DbSet<Enature> Enatures { get; set; }
        public virtual DbSet<Notice> Notices { get; set; }
        public virtual DbSet<PositionIn> PositionIns { get; set; }
        public virtual DbSet<Professional> Professionals { get; set; }
        public virtual DbSet<Province> Provinces { get; set; }
        public virtual DbSet<Result> Results { get; set; }
        public virtual DbSet<Schedule> Schedules { get; set; }
        public virtual DbSet<Student> Students { get; set; }
        public virtual DbSet<TheApplicationForm> TheApplicationForms { get; set; }
        public virtual DbSet<UndoDisciplinary> UndoDisciplinaries { get; set; }
        public virtual DbSet<Unit> Units { get; set; }
        public virtual DbSet<User> Users { get; set; }
        public virtual DbSet<VerificationCode> VerificationCodes { get; set; }
        public virtual DbSet<Worker> Workers { get; set; }
        public virtual DbSet<WorkerEvaluation> WorkerEvaluations { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            if (!optionsBuilder.IsConfigured)
            {
#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263.
                optionsBuilder.UseMySQL("server=sh-cynosdbmysql-grp-dyp7qfwe.sql.tencentcdb.com;port=20423; userid=staesEAS; password=@staesEAS;database=StarsEAS;Character Set=utf8;");
            }

        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Alert>(entity =>
            {
                entity.HasKey(e => e.AlertsId)
                    .HasName("PRIMARY");

                entity.HasIndex(e => e.WorkerId, "FK_Alerts_WorkerId_Worker_WorkerId");

                entity.HasIndex(e => e.NoticeId, "FK_NoticeId_Notice_NoticeId");

                entity.Property(e => e.AlertsId)
                    .HasColumnType("int(11)")
                    .HasComment("消息通知编号");

                entity.Property(e => e.AlertsContent)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("内容");

                entity.Property(e => e.AlertsTitle)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("标题");

                entity.Property(e => e.AlterToApplyForTime)
                    .ValueGeneratedOnAddOrUpdate()
                    .HasComment("发布时间");

                entity.Property(e => e.NoticeId)
                    .HasColumnType("int(11)")
                    .HasComment("通知分类编号S1");

                entity.Property(e => e.StudentShow)
                    .HasColumnType("int(255)")
                    .HasComment("学生是否可见");

                entity.Property(e => e.WorkerId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工工号C1");

                entity.HasOne(d => d.Notice)
                    .WithMany(p => p.Alerts)
                    .HasForeignKey(d => d.NoticeId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("FK_NoticeId_Notice_NoticeId");
            });

            modelBuilder.Entity<AlterClass>(entity =>
            {
                entity.ToTable("AlterClass");

                entity.Property(e => e.AlterClassId)
                    .HasColumnType("int(11)")
                    .HasComment("调课申请编号");

                entity.Property(e => e.AlterClassAfter)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("调课后时间");

                entity.Property(e => e.AlterClassBefore)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("调课前时间");

                entity.Property(e => e.AlterClassNote)
                    .HasMaxLength(255)
                    .HasComment("备注");

                entity.Property(e => e.AlterClassReason)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("调课原因备注");

                entity.Property(e => e.AlterClassStatus)
                    .HasColumnType("int(255)")
                    .HasComment("申请状态");

                entity.Property(e => e.AlterClassType)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("调课类型");

                entity.Property(e => e.AlterClassWay)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("调课方式");

                entity.Property(e => e.AlterToApplyForTime)
                    .ValueGeneratedOnAddOrUpdate()
                    .HasComment("申请时间");

                entity.Property(e => e.ClassId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("班级编号P1");

                entity.Property(e => e.CourseId)
                    .HasColumnType("int(11)")
                    .HasComment("课程编号L1");

                entity.Property(e => e.WorkerId)
                    .HasColumnType("int(11)")
                    .HasComment("职工编号C1");
            });

            modelBuilder.Entity<AlterResult>(entity =>
            {
                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id")
                    .HasComment("主键 自增");

                entity.Property(e => e.AlterCourseId)
                    .HasColumnType("int(11)")
                    .HasComment("课程信息编号");

                entity.Property(e => e.AlterOpeningDate).HasComment("开课日期");

                entity.Property(e => e.AlterResultsStatus)
                    .HasColumnType("int(11)")
                    .HasComment("审批状态");

                entity.Property(e => e.AlterScore)
                    .HasColumnType("int(255)")
                    .HasComment("修改成绩");

                entity.Property(e => e.ClassId)
                    .HasColumnType("int(11)")
                    .HasComment("班级");

                entity.Property(e => e.StuId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学号");

                entity.Property(e => e.WorkerId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工工号");
            });

            modelBuilder.Entity<AlterStu>(entity =>
            {
                entity.ToTable("AlterStu");

                entity.HasIndex(e => e.StuId, "FK_AlterStu_StuId_Students_StuId");

                entity.HasIndex(e => e.WorkerId, "FK_AlterStu_WorkerId_Worker_WorkerId");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.AlterClassId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("班级编号(后)");

                entity.Property(e => e.AlterNational)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("民族(后)");

                entity.Property(e => e.AlterNativePlace)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("籍贯(后)");

                entity.Property(e => e.AlterPoliticalLandscape)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("政治面貌(后)");

                entity.Property(e => e.AlterStuAge)
                    .HasColumnType("int(11)")
                    .HasComment("年龄(后)");

                entity.Property(e => e.AlterStuCarid)
                    .IsRequired()
                    .HasMaxLength(18)
                    .HasComment("身份证(后)");

                entity.Property(e => e.AlterStuName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学生姓名(后)");

                entity.Property(e => e.AlterStuPhone)
                    .IsRequired()
                    .HasMaxLength(11)
                    .HasComment("手机号(后)");

                entity.Property(e => e.AlterStuSex)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("性别(后)");

                entity.Property(e => e.AlterStuStatus)
                    .HasColumnType("int(255)")
                    .HasComment("审批状态");

                entity.Property(e => e.AlterStubackTime)
                    .HasColumnType("date")
                    .HasComment("入学时间(后)");

                entity.Property(e => e.AlterStuemail)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("电子邮箱(后)");

                entity.Property(e => e.AlterToApplyForTime)
                    .ValueGeneratedOnAddOrUpdate()
                    .HasComment("申请时间");

                entity.Property(e => e.StuId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学号B1");

                entity.Property(e => e.WorkerId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工工号C1");
            });

            modelBuilder.Entity<AlterWorker>(entity =>
            {
                entity.ToTable("AlterWorker");

                entity.HasIndex(e => e.WorkerId, "FK_AlterWorker_Worker_WorkerId");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.AlterPositionId)
                    .HasColumnType("int(11)")
                    .HasComment("职位编号(后)");

                entity.Property(e => e.AlterToApplyForTime)
                    .ValueGeneratedOnAddOrUpdate()
                    .HasComment("申请时间");

                entity.Property(e => e.AlterWorkerAge)
                    .HasColumnType("int(11)")
                    .HasComment("年龄(后)");

                entity.Property(e => e.AlterWorkerCarid)
                    .IsRequired()
                    .HasMaxLength(18)
                    .HasComment("身份证(后)");

                entity.Property(e => e.AlterWorkerLocal)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("常住地(后)");

                entity.Property(e => e.AlterWorkerName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工名字(后)");

                entity.Property(e => e.AlterWorkerPhone)
                    .IsRequired()
                    .HasMaxLength(11)
                    .HasComment("手机号(后)");

                entity.Property(e => e.AlterWorkerSex)
                    .IsRequired()
                    .HasMaxLength(1)
                    .HasComment("性别(后)");

                entity.Property(e => e.AlterWorkerStatus)
                    .HasColumnType("int(255)")
                    .HasComment("审批状态");

                entity.Property(e => e.AlterWorkerbackTime)
                    .HasColumnType("date")
                    .HasComment("入职日期(后)");

                entity.Property(e => e.WorkerId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工工号C1");
            });

            modelBuilder.Entity<Area>(entity =>
            {
                entity.ToTable("Area");

                entity.HasComment("省市区三级联动，区级");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id")
                    .HasComment("主键 自增");

                entity.Property(e => e.AreaCode)
                    .HasColumnType("int(11)")
                    .HasColumnName("areaCode")
                    .HasComment("区区域码");

                entity.Property(e => e.AreaName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasColumnName("areaName")
                    .HasDefaultValueSql("''")
                    .HasComment("区名称");

                entity.Property(e => e.CityCode)
                    .HasColumnType("int(11)")
                    .HasColumnName("cityCode")
                    .HasComment("市区域码");
            });

            modelBuilder.Entity<City>(entity =>
            {
                entity.ToTable("City");

                entity.HasComment("省市区三级联动，市级");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id")
                    .HasComment("主键 自增");

                entity.Property(e => e.CityCode)
                    .HasColumnType("int(11)")
                    .HasColumnName("cityCode")
                    .HasComment("市区域码");

                entity.Property(e => e.CityName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasColumnName("cityName")
                    .HasDefaultValueSql("''")
                    .HasComment("市名称");

                entity.Property(e => e.ProvinceCode)
                    .HasColumnType("int(11)")
                    .HasColumnName("provinceCode")
                    .HasComment("省区域码");
            });

            modelBuilder.Entity<Class>(entity =>
            {
                entity.HasIndex(e => e.ClassId, "ClassId");

                entity.HasIndex(e => e.CollegeId, "FK_Class_CollegeId_College_CollegeId");

                entity.HasIndex(e => e.ProfessionalId, "FK_Class_ProfessionalId_Professional_ProfessionalId");

                entity.HasIndex(e => e.WorkerId, "FK_Class_WorkerId_Worker_WorkerId");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.ClassId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("班级编号");

                entity.Property(e => e.CollegeId)
                    .HasColumnType("int(11)")
                    .HasComment("学院编号M1");

                entity.Property(e => e.Grade)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("年级");

                entity.Property(e => e.ProfessionalId)
                    .HasColumnType("int(11)")
                    .HasComment("专业编号G1");

                entity.Property(e => e.WorkerId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工工号C1");
            });

            modelBuilder.Entity<Classroom>(entity =>
            {
                entity.HasKey(e => e.BuildingId)
                    .HasName("PRIMARY");

                entity.ToTable("Classroom");

                entity.Property(e => e.BuildingId)
                    .HasColumnType("int(11)")
                    .HasComment("楼栋编号");

                entity.Property(e => e.ClassroomId)
                    .HasColumnType("int(11)")
                    .HasComment("教室编号");

                entity.Property(e => e.ClassroomStatus1)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("教室状态1");

                entity.Property(e => e.ClassroomStatus2)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("教室状态2");

                entity.Property(e => e.ClassroomStatus3)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("教室状态3");

                entity.Property(e => e.ClassroomStatus4)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("教室状态4");
            });

            modelBuilder.Entity<College>(entity =>
            {
                entity.ToTable("College");

                entity.Property(e => e.CollegeId)
                    .HasColumnType("int(11)")
                    .HasComment("学院编号");

                entity.Property(e => e.CollegeName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学院名称");
            });

            modelBuilder.Entity<Course>(entity =>
            {
                entity.ToTable("Course");

                entity.Property(e => e.CourseId)
                    .HasColumnType("int(11)")
                    .HasComment("课程信息编号");

                entity.Property(e => e.CourseAttribute)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasColumnName("Course_Attribute")
                    .HasComment("课程属性");

                entity.Property(e => e.CourseCredits)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasColumnName("Course_Credits")
                    .HasComment("课程学分");

                entity.Property(e => e.CourseName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("课程名称");
            });

            modelBuilder.Entity<CourseNature>(entity =>
            {
                entity.ToTable("CourseNature");

                entity.Property(e => e.CourseNatureId)
                    .HasColumnType("int(11)")
                    .HasColumnName("Course_NatureId")
                    .HasComment("课程性质编号");

                entity.Property(e => e.CourseNatureName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasColumnName("Course_NatureName")
                    .HasComment("课程性质名称");
            });

            modelBuilder.Entity<Disciplinary>(entity =>
            {
                entity.ToTable("Disciplinary");

                entity.Property(e => e.DisciplinaryId)
                    .HasColumnType("int(11)")
                    .HasComment("处分编号");

                entity.Property(e => e.DisciplinaryCategoryId)
                    .HasColumnType("int(11)")
                    .HasComment("处分类别编号W1");

                entity.Property(e => e.DisciplinaryReason)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("处分原因");

                entity.Property(e => e.DisciplinaryStatus)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("当前状态");

                entity.Property(e => e.DisciplinaryTime)
                    .HasColumnType("date")
                    .HasComment("处分时间");

                entity.Property(e => e.StuId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学号B1");

                entity.Property(e => e.WorkerId)
                    .HasColumnType("int(11)")
                    .HasComment("工号C1");
            });

            modelBuilder.Entity<DisciplinaryCategory>(entity =>
            {
                entity.ToTable("DisciplinaryCategory");

                entity.Property(e => e.DisciplinaryCategoryId)
                    .HasColumnType("int(11)")
                    .HasComment("处分类别编号");

                entity.Property(e => e.DisciplinaryCategoryName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("处分类别名称");
            });

            modelBuilder.Entity<Eapply>(entity =>
            {
                entity.ToTable("EApply");

                entity.Property(e => e.EapplyId)
                    .HasColumnType("int(11)")
                    .HasColumnName("EApplyId")
                    .HasComment("考试申请编号");

                entity.Property(e => e.CourseId)
                    .HasColumnType("int(11)")
                    .HasComment("课程信息编号L1");

                entity.Property(e => e.EapprovalNote)
                    .HasMaxLength(255)
                    .HasColumnName("EApprovalNote")
                    .HasComment("备注");

                entity.Property(e => e.EapprovalStatus)
                    .HasColumnType("int(255)")
                    .HasColumnName("EApprovalStatus")
                    .HasComment("考试审批状态");

                entity.Property(e => e.EarrangeId)
                    .HasColumnType("int(11)")
                    .HasColumnName("EArrangeId")
                    .HasComment("考试安排编号E1");

                entity.Property(e => e.EnatureId)
                    .HasColumnType("int(11)")
                    .HasColumnName("ENatureId")
                    .HasComment("考试性质编号O1");

                entity.Property(e => e.StuId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学号B1");
            });

            modelBuilder.Entity<Earrange>(entity =>
            {
                entity.ToTable("EArrange");

                entity.Property(e => e.EarrangeId)
                    .HasColumnType("int(11)")
                    .HasColumnName("EArrangeId")
                    .HasComment("考试安排编号");

                entity.Property(e => e.ClassId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("参考班级P1");

                entity.Property(e => e.CourseNatureId)
                    .HasColumnType("int(11)")
                    .HasComment("考程性质编号I1");

                entity.Property(e => e.Courseid)
                    .HasColumnType("int(11)")
                    .HasComment("课程信息编号L1");

                entity.Property(e => e.EarrangeTime)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasColumnName("EArrangeTime")
                    .HasComment("考试时间");

                entity.Property(e => e.SchedulePlace)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasDefaultValueSql("''")
                    .HasComment("开始教室");

                entity.Property(e => e.WorkerId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("监考老师C1");
            });

            modelBuilder.Entity<Enature>(entity =>
            {
                entity.ToTable("ENature");

                entity.Property(e => e.EnatureId)
                    .HasColumnType("int(11)")
                    .HasColumnName("ENatureId")
                    .HasComment("考试性质编号");

                entity.Property(e => e.EnatureName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasColumnName("ENatureName")
                    .HasComment("考试性质名称");
            });

            modelBuilder.Entity<Notice>(entity =>
            {
                entity.ToTable("Notice");

                entity.Property(e => e.NoticeId)
                    .HasColumnType("int(11)")
                    .HasComment("通知类别编号");

                entity.Property(e => e.NoticeName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("通知类别名称");
            });

            modelBuilder.Entity<PositionIn>(entity =>
            {
                entity.HasKey(e => e.PositionId)
                    .HasName("PRIMARY");

                entity.ToTable("PositionIn");

                entity.Property(e => e.PositionId)
                    .HasColumnType("int(11)")
                    .HasComment("职位编号");

                entity.Property(e => e.PositionName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职位名称");
            });

            modelBuilder.Entity<Professional>(entity =>
            {
                entity.ToTable("Professional");

                entity.Property(e => e.ProfessionalId)
                    .HasColumnType("int(11)")
                    .HasComment("专业编号");

                entity.Property(e => e.CollegeId)
                    .HasColumnType("int(11)")
                    .HasComment("学院编号");

                entity.Property(e => e.ProfessionalName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("专业名称");
            });

            modelBuilder.Entity<Province>(entity =>
            {
                entity.HasComment("省市区三级联动，省级");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id")
                    .HasComment("主键 自增");

                entity.Property(e => e.ProvinceCode)
                    .HasColumnType("int(11)")
                    .HasColumnName("provinceCode")
                    .HasComment("省区域码");

                entity.Property(e => e.ProvinceName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasColumnName("provinceName")
                    .HasDefaultValueSql("''")
                    .HasComment("省名称");
            });

            modelBuilder.Entity<Result>(entity =>
            {
                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.ClassId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("班级P1");

                entity.Property(e => e.CourseId)
                    .HasColumnType("int(11)")
                    .HasComment("课程信息编号L1");

                entity.Property(e => e.OpeningDate)
                    .HasColumnType("date")
                    .HasComment("开课日期");

                entity.Property(e => e.ResultsNote)
                    .HasMaxLength(255)
                    .HasComment("备注");

                entity.Property(e => e.ResultsStatus)
                    .HasColumnType("int(255)")
                    .HasColumnName("Results_Status")
                    .HasComment("审批状态");

                entity.Property(e => e.Score)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("成绩");

                entity.Property(e => e.StuId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学号B1");

                entity.Property(e => e.WorkerId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工工号C1");
            });

            modelBuilder.Entity<Schedule>(entity =>
            {
                entity.ToTable("Schedule");

                entity.HasIndex(e => e.ClassId, "FK_Schedule_ClassId_Class_ClassId");

                entity.HasIndex(e => e.CollegeId, "FK_Schedule_CollegeId_College_CollegeId");

                entity.HasIndex(e => e.CourseId, "FK_Schedule_CourseId_Course_CourseId");

                entity.HasIndex(e => e.WorkerId, "FK_Schedule_WorkerId_Worker_WorkerId");

                entity.Property(e => e.ScheduleId)
                    .HasColumnType("int(11)")
                    .HasComment("课表信息编号");

                entity.Property(e => e.ClassId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("班级编号P1");

                entity.Property(e => e.CollegeId)
                    .HasColumnType("int(11)")
                    .HasComment("上课院系编号M1");

                entity.Property(e => e.CourseId)
                    .HasColumnType("int(11)")
                    .HasComment("课程信息编号L1");

                entity.Property(e => e.SchedulePlace)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("地点");

                entity.Property(e => e.ScheduleWeek)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("星期");

                entity.Property(e => e.ScheduleWeekly)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("周次");

                entity.Property(e => e.ScheduleWhat)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("节次");

                entity.Property(e => e.SchoolSemester)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学年学期");

                entity.Property(e => e.Semester)
                    .HasColumnType("int(11)")
                    .HasComment("上课学期");

                entity.Property(e => e.WorkerId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工编号C1");
            });

            modelBuilder.Entity<Student>(entity =>
            {
                entity.HasIndex(e => e.ClassId, "FK_Student_ClassId_Classs_ClassId");

                entity.HasIndex(e => e.StuId, "FK_Student_StuId_User_Username");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.ClassId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("班级编号P1");

                entity.Property(e => e.National)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("民族");

                entity.Property(e => e.NativePlace)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("籍贯");

                entity.Property(e => e.PoliticalLandscape)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("政治面貌");

                entity.Property(e => e.StateOfTheSchool)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("在校状态");

                entity.Property(e => e.StuAge)
                    .HasColumnType("int(11)")
                    .HasComment("年龄");

                entity.Property(e => e.StuCarid)
                    .IsRequired()
                    .HasMaxLength(18)
                    .HasComment("身份证");

                entity.Property(e => e.StuEmail)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("电子邮箱");

                entity.Property(e => e.StuId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学号");

                entity.Property(e => e.StuName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学生姓名");

                entity.Property(e => e.StuPhone)
                    .IsRequired()
                    .HasMaxLength(11)
                    .HasComment("手机号");

                entity.Property(e => e.StuSex)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("性别");

                entity.Property(e => e.StubackTime)
                    .HasColumnType("date")
                    .HasComment("入学时间");
            });

            modelBuilder.Entity<TheApplicationForm>(entity =>
            {
                entity.ToTable("TheApplicationForm");

                entity.HasComment("申请表总览");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.ApplicantsId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasDefaultValueSql("''")
                    .HasComment("用户名(申请者)");

                entity.Property(e => e.ApplicationType)
                    .HasColumnType("int(11)")
                    .HasComment("申请类型");

                entity.Property(e => e.ByTheTime)
                    .HasDefaultValueSql("CURRENT_TIMESTAMP")
                    .HasComment("发起时间");

                entity.Property(e => e.InfoJson)
                    .IsRequired()
                    .HasColumnType("longtext")
                    .HasColumnName("InfoJSON")
                    .HasComment("信息JSON");

                entity.Property(e => e.Status)
                    .HasColumnType("int(11)")
                    .HasComment("当前状态");
            });

            modelBuilder.Entity<UndoDisciplinary>(entity =>
            {
                entity.ToTable("UndoDisciplinary");

                entity.Property(e => e.UndoDisciplinaryId)
                    .HasColumnType("int(11)")
                    .HasComment("撤销处分编号");

                entity.Property(e => e.DisciplinaryId)
                    .HasColumnType("int(11)")
                    .HasComment("处分编号V1");

                entity.Property(e => e.StuId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学号B1");

                entity.Property(e => e.UndoDisciplinaryReason)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("原因");

                entity.Property(e => e.UndoDisciplinaryStatus)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("审批状态");
            });

            modelBuilder.Entity<Unit>(entity =>
            {
                entity.ToTable("Unit");

                entity.Property(e => e.UnitId)
                    .HasColumnType("int(11)")
                    .HasComment("单位编号");

                entity.Property(e => e.UnitName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("单位名称");
            });

            modelBuilder.Entity<User>(entity =>
            {
                entity.HasIndex(e => e.Username, "Username");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id")
                    .HasComment("主键自增");

                entity.Property(e => e.Password)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("密码");

                entity.Property(e => e.PositionId)
                    .HasColumnType("int(255)")
                    .HasComment("职位编号");

                entity.Property(e => e.Token)
                    .HasMaxLength(255)
                    .HasColumnName("token")
                    .HasComment("token");

                entity.Property(e => e.Username)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("账号（学号、工号）");
            });

            modelBuilder.Entity<VerificationCode>(entity =>
            {
                entity.ToTable("VerificationCode");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id");

                entity.Property(e => e.Number)
                    .IsRequired()
                    .HasMaxLength(255);

                entity.Property(e => e.SendTime).ValueGeneratedOnAddOrUpdate();

                entity.Property(e => e.VefiCode).HasMaxLength(255);
            });

            modelBuilder.Entity<Worker>(entity =>
            {
                entity.ToTable("Worker");

                entity.HasIndex(e => e.PositionId, "FK_Worker_PositionId_PositionIn_PositionId");

                entity.HasIndex(e => e.WorkerId, "FK_Worker_WorkerId_User_UserName");

                entity.Property(e => e.Id)
                    .HasColumnType("int(11)")
                    .HasColumnName("id")
                    .HasComment("主键自增");

                entity.Property(e => e.PositionId)
                    .HasColumnType("int(255)")
                    .HasComment("职位编号D1");

                entity.Property(e => e.WorkerAge)
                    .HasColumnType("int(11)")
                    .HasComment("年龄");

                entity.Property(e => e.WorkerCarid)
                    .IsRequired()
                    .HasMaxLength(18)
                    .HasComment("身份证");

                entity.Property(e => e.WorkerEmail)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("电子邮箱");

                entity.Property(e => e.WorkerId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工工号");

                entity.Property(e => e.WorkerLocal)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("常住地");

                entity.Property(e => e.WorkerName)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工名字");

                entity.Property(e => e.WorkerPhone)
                    .IsRequired()
                    .HasMaxLength(11)
                    .HasComment("手机号");

                entity.Property(e => e.WorkerSex)
                    .IsRequired()
                    .HasMaxLength(1)
                    .HasComment("性别");

                entity.Property(e => e.WorkerbackTime)
                    .HasColumnType("date")
                    .HasComment("入职日期");
            });

            modelBuilder.Entity<WorkerEvaluation>(entity =>
            {
                entity.ToTable("WorkerEvaluation");

                entity.HasIndex(e => e.CourseId, "FK_WorkerEvaluation_CourseId_Course_CourseId");

                entity.HasIndex(e => e.StuId, "FK_WorkerEvaluation_Students_StuId");

                entity.HasIndex(e => e.WorkerId, "FK_WorkerEvaluation_Worker_WorkerId");

                entity.Property(e => e.WorkerEvaluationId)
                    .HasColumnType("int(11)")
                    .HasComment("教师评价编号");

                entity.Property(e => e.CourseId)
                    .HasColumnType("int(11)")
                    .HasComment("课程编号L1");

                entity.Property(e => e.StuId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("学号B1");

                entity.Property(e => e.WorkerEvaluationOption1)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("教评选项1");

                entity.Property(e => e.WorkerEvaluationOption2)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("教评选项2");

                entity.Property(e => e.WorkerEvaluationOption3)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("教评选项3");

                entity.Property(e => e.WorkerEvaluationOption4)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("教评选项4");

                entity.Property(e => e.WorkerEvaluationOption5)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("教评选项5");

                entity.Property(e => e.WorkerId)
                    .IsRequired()
                    .HasMaxLength(255)
                    .HasComment("职工编号C1");
            });

            OnModelCreatingPartial(modelBuilder);
        }

        partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
    }
}
